package com.example.dql.diary.Http;

import android.content.Context;
import android.os.Handler;

import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;

/**
 * Created by dql on 2018/3/1.
 */

public class Api {
    private HttpRequest mHttpRequest;
    private Map<String,Integer> mHttpTag;
    private Handler mHandler;
    private Context context;
    public Api(Handler handler,Context context){
        mHttpRequest = new HttpRequest(handler,context);
        mHttpTag = new HashMap<>();
        this.mHandler = handler;
    }
/*
   获取天气
 */
    public void getWhether(int what,String location,String key){
        String url ="https://free-api.heweather.com/s6/weather/now";
        TreeMap<String,String> paramsTreeMap = new TreeMap<>();
        paramsTreeMap.put("location",location);
        paramsTreeMap.put("key",key);
        mHttpRequest.doPost(url,what,"getWhether",paramsTreeMap);
        mHttpTag.put("getWhether",0);
    }


}
